﻿using UnityEngine;
using System.Collections;

public class BasePanel : MonoBehaviour {
    protected UIManager uiMgr;
    private GameFacade gameFacade;

    public UIManager UIMgr
    {
        set { uiMgr = value; }
    }

    public GameFacade Facade
    {
        set { gameFacade = value; }
    }

    /// <summary>
    /// 按键声
    /// </summary>
    protected void PlayClickSound()
    {
        gameFacade.PlayNormalSound(AudioManager.Sound_ButtonClick);
    }

    /// <summary>
    /// 界面被显示出来
    /// </summary>
    public virtual void OnEnter()
    {
        gameObject.SetActive(true);
    }

    /// <summary>
    /// 界面暂停
    /// </summary>
    public virtual void OnPause()
    {
        gameObject.SetActive(false);
    }

    /// <summary>
    /// 界面继续
    /// </summary>
    public virtual void OnResume()
    {
        gameObject.SetActive(true);
    }

    /// <summary>
    /// 界面不显示,退出这个界面，界面被关系
    /// </summary>
    public virtual void OnExit()
    {
        gameObject.SetActive(false);
    }
}
